<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="dwz" uri="http://www.lyjuan.cn/dwz/tags" %>

<form id="pagerForm" method="post" action="<dwz:url url="action/actionList"/>">
	<input type="hidden" name="pageNum" value="<c:out value="${param.pageNum}" default="1"/>" />
	<input type="hidden" name="name" value="${param.name}" />
	<input type="hidden" name="groupid" value="${param.groupid}" />
	<input type="hidden" name="actionurl" value="${param.actionurl}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="<dwz:url url="action/actionList"/>" method="post">
	<div class="searchBar">
		<table class="searchContent">
			<tr>
                <td>
                    <dwz:elt htmlName="a" url="group/selectGroup" lookupgroup="selectGroup" lookuppk="groupid">
                        选择组：
                        <input type="hidden" name="groupid" btnBackName="selectGroup.groupid" value="${group.id}" />
                    </dwz:elt>
                </td>
				<td>名称：
                    <input type="text" name="name" value="${param.name}" />
				</td>
				<td>地址：
                    <input type="text" name="actionurl" value="${param.actionurl}" />
				</td>
				<td>导航：
					<select name="isnav">
						<option value="">全部</option>
						<option <c:if test="${param.isnav == '1'}">selected="selected"</c:if> value="1">导航</option>
						<option <c:if test="${param.isnav == '0'}">selected="selected"</c:if> value="0">非导航</option>
					</select>
				</td>
				<td>状态：
					<select name="status">
						<option value="">全部</option>
						<option <c:if test="${param.status == '1'}">selected="selected"</c:if> value="1">正常</option>
						<option <c:if test="${param.status == '0'}">selected="selected"</c:if> value="0">锁定</option>
					</select>
				</td>
            </tr>
            <tr>
				<td>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
				</td>
			</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li>
                <dwz:elt htmlName="a" url="action/preAddAction" data="groupid=${param.groupid}"
                         rel="action_preAddAction" target="dialog" height="350" width="400" class="add">
                    <span>添加</span>
                </dwz:elt>

		</ul>
	</div>
	<div layoutH="116">
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="30px">序号</th>
				<th width="70px">操作</th>
				<th>账号</th>
				<th>地址</th>
				<th>导航</th>
				<th>标识</th>
				<th>状态</th>
				<th>排序</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${actions}" var="list" varStatus="status">
				<tr target="sid" rel="${list.id}">
					<td>${status.index + 1}</td>
                    <td>
                        <dwz:elt htmlName="a" url="action/preUpdateAction" data="id=${list.id}"
                                 rel="action_preUpdateAction" width="400" height="350" target="dialog">
                            修改/&nbsp;
                        </dwz:elt>
                        <c:if test="${0 == list.status}">
                            <dwz:elt htmlName="a" url="action/unlock" data="id=${list.id}" rel="action_unlock"
                                   target="ajaxTodo" title="确定要解锁？" fresh="true">
                            解锁/&nbsp;
                            </dwz:elt>
                        </c:if>
                        <c:if test="${1 == list.status}">
                            <dwz:elt htmlName="a" url="action/lock" data="id=${list.id}" rel="action_lock"
                                   target="ajaxTodo" title="确定要锁定？" fresh="true">
                                锁定
                            </dwz:elt>
                        </c:if>
                    </td>
					<td>${list.name}</td>
					<td>${list.actionurl}</td>
					<td>
						<c:if test="${1 == list.isnav}">是</c:if>
					</td>
					<td>${list.rel}</td>
					<td>
						<c:if test="${0 == list.status}">锁定</c:if>
						<c:if test="${1 == list.status}">正常</c:if>
					</td>
					<td>${list.sort}</td>
				</tr>
			</c:forEach>
			
		</tbody>
	</table>
	</div>
	
	<div class="panelBar">
		<div class="pages">
			<span>共&nbsp;${totalCount}&nbsp;条</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${totalCount}" numPerPage="${numPerPage}" pageNumShown="10" currentPage="${pageNum}"></div>
	</div>
</div>
